<!--
 * @Author: Liu
 * @Date: 2023-05-04 14:18:06
 * @LastEditTime: 2023-05-19 23:12:24
-->


<template>
  <div>
    <router-view />
    <!-- <van-button @click="handleShare" block style="position:fixed;top: 50%;">
      分享测试
    </van-button> -->

  </div>
</template>
<script setup>
import { showFailToast } from "vant";
import utils from "./utils/index.js";
import { onMounted,watch } from 'vue'
import { hiddenNavigationbar } from "./appSdk";
import { onUnmounted } from "vue";
import { useRouter } from "vue-router";
const router = useRouter()

watch(
  () => router.currentRoute.value,
  (value) => {
    hiddenNavigationbar({hidden:value.path !== '/'},() => {},()=>{})
  },
  {
    immediate:true,
    deep:true
  }
)
// @ts-ignore
onMounted(() => {
  utils.setUniAppShareData({
  title: "智启新境 穿梭寰宇 共赴数智未来", //转发标题 ，不传内容为当前小程序名称
  imageUrl: "https://varwey-car.oss-cn-beijing.aliyuncs.com/topspace/2024/chess0115/share/mini.jpg",
  path: `/pages/outerweb/index?url=${encodeURIComponent('https://m.sda.changan.com.cn/ts1227/')}`
});

  hiddenNavigationbar({hidden:true},()=> {

  },()=> {})
  
   // 判断环境清空内容
   let  a = utils.getOperationEnvironment()
   let ua = window.navigator.userAgent.toLowerCase();
   // @ts-ignore
   if(!a){
      // document.write("访问异常!")
      showFailToast('访问异常')
   }
})
onUnmounted(() => {
  console.log('xxxxxxxxx,onounmounted')
})

window.oncontextmenu = function () {
  return false;
};




   // 禁用F12
  //  document.addEventListener("keydown",function(event){
  //     return  123 != event.keyCode || (event.returnValue = false)
  //  })




</script>
<style>
.noticeWidth {
  padding: 30px !important;
  font-size: 28px !important;
  letter-spacing: 1px !important;
}

.noticeWidthLoading {
  width: 16vw !important;
  height: 16vw !important;
}

.noticeWidthLoading .van-loading__spinner {
  width: 60px !important;
  height: 60px !important;
}

.noticeWidthLoading .van-toast__text {
  font-size: 20px;
  margin-top: 20px;
}

.overlayClass {
  background-color: rgba(0, 0, 0, 1) !important;
}
</style>
